import { defHttp } from "@/utils/axios/Axios"

enum Api {
    // 获取气体探头
    getGasSensor = '/laboratory/gasDevices/list',
    // 获取风机电磁阀设备
    getFanDeveiceList = '/laboratory/exhaustFanView/list',
    // 修改风机状态
    changeFanStatus = '/laboratory/exhaustFan/edit',
    // 获取所有门禁
    getAllAccess = '/largeScreen/entranceGuard/list',
    // 开启单个门禁
    openAccess = '/largeScreen/entranceGuard/open?id={id}',
    // 获取异常识别日志
    abnormalLog = '/largeScreen/abnormalBehavior/pageList',
    // 根据风机id查询风机数据
    getFanDeveiceById = '/laboratory/exhaustFanView/queryById',
    // 控制vav
    controlVav = '/vav/vavOper',
}

export const getGasSensor = (data?: any) => {
    return defHttp.get(Api.getGasSensor, data)
}

export const getFanDeveiceList = (data?: any) => {
    return defHttp.get(Api.getFanDeveiceList, data)
}

export const changeFanStatus = (data?: any) => {
    return defHttp.post(Api.changeFanStatus, data)
}

export const getAllAccess = (data?: any) => {
    return defHttp.get(Api.getAllAccess, data)
}

export const openAccess = (id: string) => {
    return defHttp.get(Api.openAccess.replace('{id}', id))
}

export const abnormalLog = (data?: any) => {
    return defHttp.get(Api.abnormalLog, data)
}

export const getFanDeveiceById = (data?: any) => {
    return defHttp.get(Api.getFanDeveiceById, data)
}

export const controlVav = (data?: any) => {
    return defHttp.get(Api.controlVav, data)
}